
clear;

Ds=24;
rCvM_b1K2=zeros(Ds,1);
rCvM_b1K5=zeros(Ds,1);
rCvM_b1K10=zeros(Ds,1);
rKS_b1K2=zeros(Ds,1);
rKS_b1K5=zeros(Ds,1);
rKS_b1K10=zeros(Ds,1);
rDn_b1=zeros(Ds,2);

rCvM_b2K2=zeros(Ds,1);
rCvM_b2K5=zeros(Ds,1);
rCvM_b2K10=zeros(Ds,1);
rKS_b2K2=zeros(Ds,1);
rKS_b2K5=zeros(Ds,1);
rKS_b2K10=zeros(Ds,1);
rDn_b2=zeros(Ds,2);

for ii=1:Ds
    if ii==1; load sim0528_K2n200_b1D1; end
    if ii==2; load sim0528_K2n400_b1D1; end
    if ii==3; load sim0528_K2n800_b1D1; end
    if ii==4; load sim0528_K2n1200_b1D1; end    
    if ii==5; load sim0528_K2n200_b1D2; end
    if ii==6; load sim0528_K2n400_b1D2; end
    if ii==7; load sim0528_K2n800_b1D2; end
    if ii==8; load sim0528_K2n1200_b1D2; end
    if ii==9; load sim0528_K2n200_b1D3; end
    if ii==10; load sim0528_K2n400_b1D3; end
    if ii==11; load sim0528_K2n800_b1D3; end
    if ii==12; load sim0528_K2n1200_b1D3; end
    if ii==13; load sim0528_K2n200_b1D4; end
    if ii==14; load sim0528_K2n400_b1D4; end
    if ii==15; load sim0528_K2n800_b1D4; end
    if ii==16; load sim0528_K2n1200_b1D4; end    
    if ii==17; load sim0528_K2n200_b1D5; end
    if ii==18; load sim0528_K2n400_b1D5; end
    if ii==19; load sim0528_K2n800_b1D5; end
    if ii==20; load sim0528_K2n1200_b1D5; end    
    if ii==21; load sim0528_K2n200_b1D6; end
    if ii==22; load sim0528_K2n400_b1D6; end
    if ii==23; load sim0528_K2n800_b1D6; end    
    if ii==24; load sim0528_K2n1200_b1D6; end    
    rCvM_b1K2(ii)=mean(Tn_CvM>cv_CvM);
    rKS_b1K2(ii)=mean(Tn_KS>cv_KS);
    rDn_b1(ii,:)=[D,n];
end

for ii=1:Ds
    if ii==1; load sim0528_K2n200_b2D1; end
    if ii==2; load sim0528_K2n400_b2D1; end
    if ii==3; load sim0528_K2n800_b2D1; end
    if ii==4; load sim0528_K2n1200_b2D1; end    
    if ii==5; load sim0528_K2n200_b2D2; end
    if ii==6; load sim0528_K2n400_b2D2; end
    if ii==7; load sim0528_K2n800_b2D2; end
    if ii==8; load sim0528_K2n1200_b2D2; end
    if ii==9; load sim0528_K2n200_b2D3; end
    if ii==10; load sim0528_K2n400_b2D3; end
    if ii==11; load sim0528_K2n800_b2D3; end
    if ii==12; load sim0528_K2n1200_b2D3; end
    if ii==13; load sim0528_K2n200_b2D4; end
    if ii==14; load sim0528_K2n400_b2D4; end
    if ii==15; load sim0528_K2n800_b2D4; end
    if ii==16; load sim0528_K2n1200_b2D4; end    
    if ii==17; load sim0528_K2n200_b2D5; end
    if ii==18; load sim0528_K2n400_b2D5; end
    if ii==19; load sim0528_K2n800_b2D5; end
    if ii==20; load sim0528_K2n1200_b2D5; end    
    if ii==21; load sim0528_K2n200_b2D6; end
    if ii==22; load sim0528_K2n400_b2D6; end
    if ii==23; load sim0528_K2n800_b1D6; end    
    if ii==24; load sim0528_K2n1200_b2D6; end    
    rCvM_b2K2(ii)=mean(Tn_CvM>cv_CvM);
    rKS_b2K2(ii)=mean(Tn_KS>cv_KS);
    rDn_b2(ii,:)=[D,n];
end

for ii=1:Ds
    if ii==1; load sim0528_K5n200_b1D1; end
    if ii==2; load sim0528_K5n400_b1D1; end
    if ii==3; load sim0528_K5n800_b1D1; end
    if ii==4; load sim0528_K5n1200_b1D1; end    
    if ii==5; load sim0528_K5n200_b1D2; end
    if ii==6; load sim0528_K5n400_b1D2; end
    if ii==7; load sim0528_K5n800_b1D2; end
    if ii==8; load sim0528_K5n1200_b1D2; end
    if ii==9; load sim0528_K5n200_b1D3; end
    if ii==10; load sim0528_K5n400_b1D3; end
    if ii==11; load sim0528_K5n800_b1D3; end
    if ii==12; load sim0528_K5n1200_b1D3; end
    if ii==13; load sim0528_K5n200_b1D4; end
    if ii==14; load sim0528_K5n400_b1D4; end
    if ii==15; load sim0528_K5n800_b1D4; end
    if ii==16; load sim0528_K5n1200_b1D4; end    
    if ii==17; load sim0528_K5n200_b1D5; end
    if ii==18; load sim0528_K5n400_b1D5; end
    if ii==19; load sim0528_K5n800_b1D5; end
    if ii==20; load sim0528_K5n1200_b1D5; end    
    if ii==21; load sim0528_K5n200_b1D6; end
    if ii==22; load sim0528_K5n400_b1D6; end
    if ii==23; load sim0528_K5n800_b1D6; end    
    if ii==24; load sim0528_K5n1200_b1D6; end    
    rCvM_b1K5(ii)=mean(Tn_CvM>cv_CvM);
    rKS_b1K5(ii)=mean(Tn_KS>cv_KS);
end

for ii=1:Ds
    if ii==1; load sim0528_K5n200_b2D1; end
    if ii==2; load sim0528_K5n400_b2D1; end
    if ii==3; load sim0528_K5n800_b2D1; end
    if ii==4; load sim0528_K5n1200_b2D1; end    
    if ii==5; load sim0528_K5n200_b2D2; end
    if ii==6; load sim0528_K5n400_b2D2; end
    if ii==7; load sim0528_K5n800_b2D2; end
    if ii==8; load sim0528_K5n1200_b2D2; end
    if ii==9; load sim0528_K5n200_b2D3; end
    if ii==10; load sim0528_K5n400_b2D3; end
    if ii==11; load sim0528_K5n800_b2D3; end
    if ii==12; load sim0528_K5n1200_b2D3; end
    if ii==13; load sim0528_K5n200_b2D4; end
    if ii==14; load sim0528_K5n400_b2D4; end
    if ii==15; load sim0528_K5n800_b2D4; end
    if ii==16; load sim0528_K5n1200_b2D4; end    
    if ii==17; load sim0528_K5n200_b2D5; end
    if ii==18; load sim0528_K5n400_b2D5; end
    if ii==19; load sim0528_K5n800_b2D5; end
    if ii==20; load sim0528_K5n1200_b2D5; end    
    if ii==21; load sim0528_K5n200_b2D6; end
    if ii==22; load sim0528_K5n400_b2D6; end
    if ii==23; load sim0528_K5n800_b2D6; end    
    if ii==24; load sim0528_K5n1200_b2D6; end    
    rCvM_b2K5(ii)=mean(Tn_CvM>cv_CvM);
    rKS_b2K5(ii)=mean(Tn_KS>cv_KS);
end

for ii=1:Ds
    if ii==1; load sim0528_K10n200_b1D1; end
    if ii==2; load sim0528_K10n400_b1D1; end
    if ii==3; load sim0528_K10n800_b1D1; end
    if ii==4; load sim0528_K10n1200_b1D1; end    
    if ii==5; load sim0528_K10n200_b1D2; end
    if ii==6; load sim0528_K10n400_b1D2; end
    if ii==7; load sim0528_K10n800_b1D2; end
    if ii==8; load sim0528_K10n1200_b1D2; end
    if ii==9; load sim0528_K10n200_b1D3; end
    if ii==10; load sim0528_K10n400_b1D3; end
    if ii==11; load sim0528_K10n800_b1D3; end
    if ii==12; load sim0528_K10n1200_b1D3; end
    if ii==13; load sim0528_K10n200_b1D4; end
    if ii==14; load sim0528_K10n400_b1D4; end
    if ii==15; load sim0528_K10n800_b1D4; end
    if ii==16; load sim0528_K10n1200_b1D4; end    
    if ii==17; load sim0528_K10n200_b1D5; end
    if ii==18; load sim0528_K10n400_b1D5; end
    if ii==19; load sim0528_K10n800_b1D5; end
    if ii==20; load sim0528_K10n1200_b1D5; end    
    if ii==21; load sim0528_K10n200_b1D6; end
    if ii==22; load sim0528_K10n400_b1D6; end
    if ii==23; load sim0528_K10n800_b1D6; end    
    if ii==24; load sim0528_K10n1200_b1D6; end    
    rCvM_b1K10(ii)=mean(Tn_CvM>cv_CvM);
    rKS_b1K10(ii)=mean(Tn_KS>cv_KS);
end

for ii=1:Ds
    if ii==1; load sim0528_K10n200_b2D1; end
    if ii==2; load sim0528_K10n400_b2D1; end
    if ii==3; load sim0528_K10n800_b2D1; end
    if ii==4; load sim0528_K10n1200_b2D1; end    
    if ii==5; load sim0528_K10n200_b2D2; end
    if ii==6; load sim0528_K10n400_b2D2; end
    if ii==7; load sim0528_K10n800_b2D2; end
    if ii==8; load sim0528_K10n1200_b2D2; end
    if ii==9; load sim0528_K10n200_b2D3; end
    if ii==10; load sim0528_K10n400_b2D3; end
    if ii==11; load sim0528_K10n800_b2D3; end
    if ii==12; load sim0528_K10n1200_b2D3; end
    if ii==13; load sim0528_K10n200_b2D4; end
    if ii==14; load sim0528_K10n400_b2D4; end
    if ii==15; load sim0528_K10n800_b2D4; end
    if ii==16; load sim0528_K10n1200_b2D4; end    
    if ii==17; load sim0528_K10n200_b2D5; end
    if ii==18; load sim0528_K10n400_b2D5; end
    if ii==19; load sim0528_K10n800_b2D5; end
    if ii==20; load sim0528_K10n1200_b2D5; end    
    if ii==21; load sim0528_K10n200_b2D6; end
    if ii==22; load sim0528_K10n400_b2D6; end
    if ii==23; load sim0528_K10n800_b2D6; end    
    if ii==24; load sim0528_K10n1200_b2D6; end    
    rCvM_b2K10(ii)=mean(Tn_CvM>cv_CvM);
    rKS_b2K10(ii)=mean(Tn_KS>cv_KS);
end

rRP_Ks=[rDn_b2,rCvM_b2K2,rCvM_b2K5,rCvM_b2K10...
                               rCvM_b1K2,rCvM_b1K5, rCvM_b1K10];

Labela ={'DGP','n','K=2','K=5','K=10','K=2','K=5','K=10'};
mat2lat (rRP_Ks,'TableC2.tex','columnlabels',Labela,'format','%2.3f','size','footnotesize');   

    
